import { Message } from 'element-ui';
import { ERROR_MESSAGE, SUCCESS_MESSAGE } from './result.config';
const $Message = function (ops) {
  const config = Object.assign(ops, {
    showClose: true
  });
  Message(config);
};
const SUCCESS_DELETE = (message) => {
  $Message({
    type: SUCCESS_MESSAGE.TYPE,
    message: message || SUCCESS_MESSAGE.DELETE
  });
};
const SUCCESS_PUT = (message) => {
  $Message({
    type: SUCCESS_MESSAGE.TYPE,
    message: message || SUCCESS_MESSAGE.PUT
  });
};
const SUCCESS_POST = (message) => {
  $Message({
    type: SUCCESS_MESSAGE.TYPE,
    message: message || SUCCESS_MESSAGE.POST
  });
};
const SUCCESS_GET = (message) => {
  $Message({
    type: SUCCESS_MESSAGE.TYPE,
    message: message || SUCCESS_MESSAGE.GET
  });
};
const SUCCESS_BATCH_DELETE = (message) => {
  $Message({
    type: SUCCESS_MESSAGE.TYPE,
    message: message || SUCCESS_MESSAGE.BATCH_DELETE
  });
};
const SUCCESS_UPDATE_STATUS = (message) => {
  $Message({
    type: SUCCESS_MESSAGE.TYPE,
    message: message || SUCCESS_MESSAGE.UPDATE_STATUS
  });
};
const ERROR_FORMAT = (message) => {
  $Message({
    type: ERROR_MESSAGE.TYPE,
    message: message || ERROR_MESSAGE.FORMAT
  });
};
const ERROR_REQUEST = (message) => {
  $Message({
    type: ERROR_MESSAGE.TYPE,
    message: message || ERROR_MESSAGE.REQUEST
  });
};
const ERROR_NO_DATA = (message) => {
  $Message({
    type: ERROR_MESSAGE.TYPE,
    message: message || ERROR_MESSAGE.NO_DATA
  });
};
const ERROR_UNKNOWN = (message) => {
  $Message({
    type: ERROR_MESSAGE.TYPE,
    message: message || ERROR_MESSAGE.UNKNOWN
  });
};
export default {
  SUCCESS_DELETE, // 删除成功提示
  SUCCESS_PUT, // 修改成功提示
  SUCCESS_POST, // 新增成功提示
  SUCCESS_GET, // get请求提示
  SUCCESS_BATCH_DELETE, // 批量删除成功提示
  SUCCESS_UPDATE_STATUS, // 批量状态修改成功提示
  ERROR_FORMAT, // 格式错误
  ERROR_REQUEST, // 请求失败
  ERROR_NO_DATA, // 无数据
  ERROR_UNKNOWN // 后台未返回错误，未知错误
};
